<script type="text/javascript" src="js/Calendar.js"></script>
<link rel="stylesheet" type="text/css" href="css/page.css"/>
<link rel="stylesheet" href="http://www.12301.cc/css/common/www.12301.cc.global.css"/>
<script type="text/javascript" src="http://www.12301.cc/js/global/www.12301.cc.global.js"></script>

<style>
.wrap{width:80%;float:right;}
.fxsgl{ border:1px solid #B0DFFD; background:#F9FCFF; color:#3e3e3e; font-size:12px; margin:12px 0; width:100%; line-height:30px; }
.fxsgl th{ border-top:1px dashed #DADBDB; text-align:center;} 
.fxsgl td{ border:1px dashed #DADBDB; text-align:center;}
.fxsgl .thead th{ background:#D7EFFF; text-align:left; line-height:25px; height:25px; padding-left:10px; border-bottom:1px solid #B0DFFD;}
.fxsgl .thead td{ border:0; text-align:left; padding-left:20px; height:30px; line-height:30px;}
.inputtext{ width:80px; height:21px; line-height:21px; border:1px solid #829FBB; vertical-align:-1px\9; *vertical-align:-3px; padding:0 2px;}
.inputbtn{ padding-left:12px; height:23px; line-height:25px\9; border:0; background:url(images/btn23_two1.png) no-repeat; margin:0 0px 0 0px; display:inline-block; cursor:pointer;}
.inputbtn span{ height:23px; line-height:23px; padding-right:12px; background:url(images/btn23_two1.png) no-repeat right top; color:#FFF; font-weight:700; display:inline-block; width:auto;}
.inputbtn:hover{ background:url(images/btn23_two1.png) no-repeat left bottom; text-decoration:none;}
.inputbtn:hover span{ background:url(images/btn23_two1.png) no-repeat right bottom; text-decoration:none;}
.carysea{ border:1px solid #FFCC80; background:#FFFFE5; padding:10px;}
.carysea p{ height:30px; line-height:30px; margin-left:20px;}
.carysea p span{ margin:0 7px;} 
.inptext{ width:100px;}
.inpbtn{ font-size:14px; font-weight:bold; color:#FFF; cursor: pointer;background: url(http://www.12301.cc/images/img/btn_search_27.png) no-repeat 0 0;border: none;width: 60px;height: 27px; margin-left:20px;}
.inpbtn:hover{ background-position:0 -27px;}
.wid200{ width:260px; display:inline-block;}
.bgnav a.backm{ float:right;margin-right: 15px;font-size: 13px;color: #008FC2;font-weight: bold;}
.mar10{ margin-left:10px;}
.setalign{text-align:center;}
/*遮罩*/
#Mask_div{z-index:1000;background-color:gray; opacity:0.5; position:absolute; top:0; z-index:9000; filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5; } 
#pop_refund{ background-color:#fff;border:5px solid rgba(127, 124, 134, 0.4);  height:270px; left:50%; margin:-200px 0 0 -200px; padding:1px; position:fixed !important; /* 浮动对话框 */ 
position:absolute; top:55%; width:400px; z-index:9999; border-radius:5px; display:none;text-align:center;  } 
.no_unline a{text-decoration:none;}
.no_unline a:hover{text-decoration:none;}
.refund_title{height:60px;line-height:60px;font-size:16px;text-align:left;margin-left:30px;}
.delrefun{font-size:14px}
#PopWindow{ padding:20px; border:4px solid #bbb}
#PopWindow textarea{width:200px;}
#PopWindow .btn{ width:100px; height:25px; font-size:12px; cursor:pointer}
.td-medium{ width: 320px;}
.td-small{width: 230px;}
p.p_top{border-bottom:1px solid #D4E7FF;}
p .again{display:inline-block;width:180px;}
p .people{display:inline-block;}
p.re{position:relative;}
.print_t{cursor:pointer;}
#box_frm{width:400px;height:220px;margin:0 auto;}
#box_frm .sub_b{text-align: center;margin-top: 20px;}
#box_frm #input_txt{width:320px;height:120px;padding:10px;resize: none;border:1px solid #rgba(127, 124, 134, 0.4);}
.btn_submit{width: 100px;height: 30px;margin-right: 10px;
line-height: 30px;border: 0;font-size: 1.4em;background-color: #00a0e9;text-align: center;font-weight: normal;
color: #FFF;cursor: pointer;}
.bei{  float:left;width: 97px;height:31px;line-height: 31px;overflow: hidden;white-space: nowrap; text-overflow: ellipsis;cursor:pointer;}
.fxsgl td.setBorder{border-right:0 none;}
</style>
<div class="wrap">
  <form action="" id="main_form">
      <input type="hidden" name="id" value="<?=$id?>" />
      <input type="hidden" name="excel" value="0"/>
    <div class="carysea">
    	<p>
        	<b>时间查询：</b><span><input type="text" class="inputtext inptext" name="op" onmouseup="SelectDate(this,'yyyy-MM-dd',0,0)" value="<?=$op?>"/></span>至<span><input type="text" class="inputtext inptext" name="ed" onmouseup="SelectDate(this,'yyyy-MM-dd',0,0)" value="<?=$ed?>"/></span>
            <span>
                <input type="submit" class="inpbtn" value="查询"/>
                <input id="Excel"    class="inpbtn" value="    导出"/></span>
            <span></span>
        </p>
    </div>
  </form>
	
    <!--  <form action="call/setFund.php"  name="form" id="form_order">  -->
	<!--<form action="admin/pppp.php"  name="form" id="form_order">-->
	<input type="hidden" name="act" class="act" id="act" />
	<input type="hidden" name="did" class="did" value="<?=$id?>"/>
	<input type="hidden" name="pt" class="pt" value="<?=$passport?>"/>
	<input type="hidden"  class="type" value=""/>
	<input type="hidden"  name="meno" class="input_" value=""/>
	<?if($_SERVER['HTTP_HOST']=='www.12301.cc'):?>
		<input type="hidden" id="type_type" value="0">
		<?else:?>
		<input type="hidden" id="type_type" value="1">
		<?endif;?>
	<table cellpadding="0" cellspacing="0" class="fxsgl" id="tb">
    	<tr class="thead">
        	<th colspan="5"><?=$dname?>（账号:<?=$passport?>）</th>
        </tr>
        <tr class="thead">
        	<td colspan="4">
                <?if($_SESSION['memberID']!=1){?>
                    授信额度：<input type="text" class="inputtext" name="cmoney" id="cmoney" value="<?=$cmoney?>"/>
                    <a class="inputbtn oredr_pay" data-type="c" ><!-- onclick="$('#act').val('c');document.forms['form'].submit();$('#cmoney').val('');" --><span>修改</span></a>
                    <i class="wid200 setalign">
					 <?echo "授信可用额度";
					}else{
						echo "当前账户余额";}
					?>：<?=$tmoney?>元
					</i>
                   <input type="text" id="tmoney" name="tmoney" class="inputtext mar10" value=""/>
                <?if($_SESSION['memberID']!=1){?><a class="inputbtn oredr_pay" data-type="t" ><!-- onclick="$('#act').val('t');document.forms['form'].submit();$('#tmoney').val('');" --><span>线下预存/还款</span></a><?
                }else{
                    ?><a class="inputbtn oredr_pay" data-type="z" ><!-- onclick="$('#act').val('z');document.forms['form'].submit();$('#tmoney').val('');" --><span>线下充值</span></a><?
                }?></td>
            <?/*
            当前账户余额<?=$tmoney?>元<input type="text" id="tmoney" name="tmoney" class="inputtext mar10" />            
            <a class="inputbtn" onclick="$('#act').val('z');document.forms['form'].submit();"><span>线下充值</span></a></td>*/?>
        <td></td>
       </tr>
        <tr>
        	<th>日期</th>
            <th>操作员</th>
            <th>操作说明</th>
            <th>增加金额</th>
<!--            <th>减少金额</th>-->
            <th class="bei setBorder">备注</th>
        </tr>
	<?	foreach($_note as $v){?>
        <tr>
        	<td><?=$v['rectime']?></td>
            <td><?=$v['dname']?></td>
            <td><?=$v['dreason']?></td>
            <td><?=$v['add']?></td>
<!--            <td>--><?//=$v['redu']?><!--</td>-->
            <td class="bei setBorder" title="<?=$v['memo']?>"><?=$v['memo']?></td>
        </tr>
	<?	}?>
        <tr>
            <td></td>
            <td></td>
            <td>合计</td>
            <td><?=$total_add?></td>
            <td class="bei setBorder"></td>
        </tr>
    </table>
	<?page($total,$currentPage,$pageSize);?>
  <!-- </form> -->
</div>
<div id="pop_refund">
	<form id="box_frm">
		<h3 id="title_msg" class="refund_title">授信备注信息</h3>
		<p><textarea id="input_txt" name="other"></textarea></p>
		<div class="sub_b">
			<input type="button" value="提 交" class="btn btn_submit"/>
			<a href="#"  class="btn delrefund" onclick="closeBg();"/>取消</a>
		</div>
	</form>
</div>
<script>

$(".oredr_pay").on("click",function(){
	var daty_t = $(this).attr("data-type");
	$(".type").val(daty_t);
	var bh = $("html").height();   
	var bw = $("html").width();      
	$("#mask").css({ height:bh, width:bw, display:"block" });
	$("#pop_refund").show(); 
	$("#input_txt").val(null);
})
	$("#pop_refund").on('click', '.btn_submit', function(){
		var ytpe = $("#type_type").val();
		if(ytpe=="0"){
			var url = "call/setFund_n.php";
		
		}
		else{
			var url = "call/setFund_n.php";
		}
		var meno = $("#input_txt").val();
		var act= $(".type").val();
		var did =$(".did").val();
		var pt =$(".pt").val();
		var cmoney =$("#cmoney").val();
		var tmoney =$("#tmoney").val();
		var postData ={
			act : act,
			did : did,
			pt : pt,
			cmoney :cmoney,
			tmoney :tmoney,
			meno : meno
		}
		$.ajax({
			type:'POST',url: url,data: postData, dataType:'json',
			//type:'POST',url: 'http://www.12301.cc/admin/pppp.php',data: postData, dataType:'json',
		}).done(function(res) {
			if(res.status=="success"){
				PFT_GLOBAL.U.Alert("success",'<p style="width:120px">'+res.msg+'</p>');
				location.reload();
			}
			else{
				PFT_GLOBAL.U.Alert("fail",'<p style="width:120px">'+res.msg+'</p>');
			}
		})
		 $("#mask,#pop_refund").hide();  
		 $("#tmoney").val("");
		 $("#cmoney").val("");
		
	})
function closeBg() { 
    $("#mask,#pop_refund").hide(); 
} 

    $("#Excel").click(function(){
        $("input[name='excel']").val('1');
        $("form#main_form").submit();
        $("input[name='excel']").val('0');
    })

</script>